package UnOfficeDeTourisme;

/**
 * Enum definition : mode
 *
 * @author OpenORB Compiler
*/
public final class mode implements org.omg.CORBA.portable.IDLEntity
{
    /**
     * Enum member pied value 
     */
    public static final int _pied = 0;

    /**
     * Enum member pied
     */
    public static final mode pied = new mode(_pied);

    /**
     * Enum member velo value 
     */
    public static final int _velo = 1;

    /**
     * Enum member velo
     */
    public static final mode velo = new mode(_velo);

    /**
     * Enum member voiture value 
     */
    public static final int _voiture = 2;

    /**
     * Enum member voiture
     */
    public static final mode voiture = new mode(_voiture);

    /**
     * Enum member metro value 
     */
    public static final int _metro = 3;

    /**
     * Enum member metro
     */
    public static final mode metro = new mode(_metro);

    /**
     * Enum member bus value 
     */
    public static final int _bus = 4;

    /**
     * Enum member bus
     */
    public static final mode bus = new mode(_bus);

    /**
     * Internal member value 
     */
    private final int _mode_value;

    /**
     * Private constructor
     * @param  the enum value for this new member
     */
    private mode( final int value )
    {
        _mode_value = value;
    }

    /**
     * Maintains singleton property for serialized enums.
     * Issue 4271: IDL/Java issue, Mapping for IDL enum.
     */
    public java.lang.Object readResolve() throws java.io.ObjectStreamException
    {
        return from_int( value() );
    }

    /**
     * Return the internal member value
     * @return the member value
     */
    public int value()
    {
        return _mode_value;
    }

    /**
     * Return a enum member from its value
     * @param  an enum value
     * @return an enum member
         */
    public static mode from_int(int value)
    {
        switch (value)
        {
        case 0 :
            return pied;
        case 1 :
            return velo;
        case 2 :
            return voiture;
        case 3 :
            return metro;
        case 4 :
            return bus;
        }
        throw new org.omg.CORBA.BAD_OPERATION();
    }

    /**
     * Return a string representation
     * @return a string representation of the enumeration
     */
    public java.lang.String toString()
    {
        switch (_mode_value)
        {
        case 0 :
            return "pied";
        case 1 :
            return "velo";
        case 2 :
            return "voiture";
        case 3 :
            return "metro";
        case 4 :
            return "bus";
        }
        throw new org.omg.CORBA.BAD_OPERATION();
    }

}
